1f7eafc926c290433b806443c391a0fff5c92d3b,samples/iotfdevicemanagement/src/com/ibm/iotf/sample/devicemgmt/gateway/home/HomeGatewaySample.java,HomeGatewaySample,main,#String[]#,181

Before Change


				// exist yet) with gateway credentials
				for (Device device : attachedDevices) {
					try {
						System.out.println("<-- Adding device "+device.getDeviceId());
						sample.mgdGateway.api().getDevice(device.getDeviceType(), device.getDeviceId());
					} catch (IoTFCReSTException ex) {
						if (ex.getHttpCode() == 404) {

After Change


				// exist yet) with gateway credentials
				for (Device device : attachedDevices) {
					try {
						System.out.println("<-- Checking if device "+device.getDeviceId() +" with deviceType " +
															device.getDeviceType() +" exists in Watson IoT Platform");
						boolean exist = sample.mgdGateway.api().isDeviceExist(device.getDeviceType(), device.getDeviceId());
						if(!exist) {
							System.out.println("<-- Creating device "+device.getDeviceId() +" with deviceType " +